<template>
  <div class="shop">
    <div class="shop_title">
      <p class="center">购物车</p>
      <p class="goout">删除</p>
    </div>
    <div class="shopBig">
         <div class="boxshop" v-for="item in listShop" :key="item.id">
          <van-checkbox v-model="checked"></van-checkbox>
          <img :src="item.small_image" alt="" class="img1"/>
          <div class="shop_text">
            <p style="font-size:.25rem;margin-top:.5rem;">{{ item.name }}</p>
            <p style="font-size:.3rem;margin-top:.5rem;">￥{{ item.price}}</p>
          </div>
          
          <div class="add">
            <button>-</button>
              <input type="text" value="1">
            <button>+</button>
          </div>
        </div>
    </div>
    
    <div class="shop_bottom">
      <van-submit-bar :price="3050" button-text="提交订单" @click="onclick()">
        <van-checkbox>全选</van-checkbox>
      </van-submit-bar>
    </div>
  </div>
</template>

<script>
import Vue from "vue";
import { Button, Card,Stepper } from "vant";
import { Checkbox, CheckboxGroup } from 'vant';
Vue.use(Button);
Vue.use(Card);
Vue.use(Stepper);
Vue.use(Checkbox);
Vue.use(CheckboxGroup);
export default {
  name: "ShopView",
  data() {
    return {
      checked: true,
      value: 1,
      listShop: [],
      changeShop:[]
    };
  },
  async mounted() {
    let res = await this.$store.state.listProt;
    this.listShop = res;
    console.log(this.listShop);
  },
  methods:{
    onclick(){
      //  this.$router.push('money')
      alert(1)
    }
  }
};
</script>

<style lang="scss" scoped>
.shop {
  height: auto;
  background: #f5f5f5;
}
.shopBig{
  height:auto;
  margin-bottom:2rem;
}
.van-stepper__input{
  width:.3rem;
  height: .3rem;
}
.shop_title {
  width: 7.5rem;
  height: 1.2rem;
  display: flex;
  background: #fff;
  line-height: 0.8rem;
  .shop_middle {
    height: 1rem;
  }
  .center {
    font-size: 0.4rem;
    margin-left: 3.3rem;
    line-height: 1rem;
    line-height:.5rem;
  }
  .goout {
    font-size: 0.3rem;
    text-align: right;
    line-height: .8rem;
    margin-left: 2rem;
    color: rgb(0, 172, 0);
  }
}
.shop_bottom {
  width: 7.5rem;
  height: 2rem;
  position: fixed;
  bottom: 1rem;
  .van-submit-bar {
    position: fixed;
    bottom: 1rem;
  }
}
.van-card {
  background: #fff;
  margin-top: 0.4rem;
}
.boxshop{
  width:7.5rem;
  height:2.5rem;
  background: #fff;
  margin-top:.4rem;
  display: flex;
  justify-content: space-between;
  .add{
    display: flex;
    margin-top:1rem;
    margin-right:.3rem;
    button{
      width:.4rem;
      height:.4rem;
      display: block;
      border:0 none;
      line-height: .4rem;
      font-size: .35rem;
      margin-top:.4rem;
      background: #fff;
    }
    input{
      width:.6rem;
      height:.35rem;
      margin-top:.42rem;
      display: flex;
      border:0 none;
      font-size: .3rem;
      text-align: center;
      background: #e8e8e8;
    }
  }
  .img1{
    width:1.5rem;
    height: 1.5rem;
    margin-left:.1rem;
    margin-top:.4rem;
    display: block;
  }
  .van-checkbox{
    margin-left:.3rem;
  }
}

</style>